<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>审核记录</title>
    <%
        /********** 保存网站的基本路径 ***********/
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                + path + "/";
        //将该路径地址缓存到 session中 ,例如：http://localhost:8090/tjnu_ssh_1128/
        session.setAttribute("mybasePath", basePath);

    %>
    <!-- CSS -->
    <jsp:include page="../include/headtag.jsp" />
    <!-- <link rel="stylesheet"
        href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500"> -->
    <link rel="stylesheet"
          href="${mybasePath}assets/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${mybasePath}assets/css/form-elements.css">
    <link rel="stylesheet" href="${mybasePath}assets/css/style.css">
</head>
<body>
<jsp:include page="../include/head.jsp" />
<jsp:include page="../include/menu.jsp" />
<div id="page-wrapper" style="margin-top: 50px;">
    <form class="form-search form-horizontal" id="setchInfo"
          action="<c:url value='/allHos/1' />"></form>
    <div id="page-inner">
        <div class="text-left">
            <a href="/index">首页</a>&nbsp;&gt;&nbsp;<a href="/auditing" class="acts CurrChnlCls">编码审核</a>&nbsp;&gt;&nbsp;<a href="/auditing/hislist" class="acts CurrChnlCls">审核历史记录</a>
        </div>
        <div class="row">
            <div class="col-md-12">
                <h3 class="text-left">审核历史记录</h3>
            </div>
        </div>
        <hr />
        <table class="table table-striped table-hover text-left">
            <thead>
            <tr>
                <th style="text-align: center;">审核事物</th>
                <th style="text-align: center;">申请操作</th>
<%--                <th style="text-align: center;">申请人员</th>--%>
                <th style="text-align: center;">审核结果</th>
                <th style="text-align: center;">操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="record" items="${records}" varStatus="s">
                <tr>
                    <td style="text-align: center;">${record.objectName }</td>
                    <td style="text-align: center;">${record.operation }</td>
<%--                    <td style="text-align: center;">${record.userId}</td>--%>
                    <td style="text-align: center;">
                        <c:choose>
                            <c:when test="${record.result==2}">
                                未通过审核
                            </c:when>
                            <c:otherwise>
                                通过审核
                            </c:otherwise>
                        </c:choose>
                    </td>
                    <td>
                        <div class="col-lg-4"></div>
                        <a onclick="redir_to_AuditingInfo(${record.index})" class="btn btn-info btn-sm ">查看审核详情</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>

        <c:if test="${pages.totalPage > 0}">
            <ul class="pagination pagination-lg">
                <li <c:if test="${pages.currentPage < 1}">class="disabled"</c:if>><a
                        href="#">&laquo;</a></li>
                <c:forEach begin="${pages.pageNumStart }" end="${pages.pageNumEnd }"
                           varStatus="status">
                    <li
                            <c:if test="${status.index == pages.currentPage }">class="active"</c:if>>
                        <a href="javascript:void(0);" onclick="tijiao('${status.index }')">
                                ${status.index } </a>
                    </li>
                </c:forEach>
                <li
                        <c:if test="${pages.currentPage> pages.totalPage}">class="disabled"</c:if>><a
                        href="javascript:void(0);" onclick="tijiao('${pages.nextPage }')">&raquo;</a></li>
                <li><input id="tijiaoInput" name="tijiaoInput" type="text"
                           class="form-control col-md-1" style="width: 60px; height: 54.89px;"></li>
                <li><a onclick="tijiaoInput()">Go</a></li>
                <li class="disabled"><a>共${pages.totalPage}页${pages.totalRecord}条记录</a>
            </ul>
        </c:if>
    </div>

    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->

</body>
<!-- Javascript -->
<script src="${mybasePath}assets/bootstrap/js/bootstrap.min.js"></script>
<script src="${mybasePath}assets/bootstrap/js/jquery.min.js"></script>
<script src="${mybasePath}assets/js/jquery.backstretch.min.js"></script>

<script type="text/javascript">
    function redir_to_AuditingInfo(id) {
        window.location.href = "/auditingInfoShow?id="+id;
    }
</script>


<script type="text/javascript">
    function tijiao(url) {
        $("#setchInfo")
            .attr("action", "<c:url value='/noticeIndex/"+url+"' />");
        $("#setchInfo").submit();
        return false;
    }
</script>

<script type="text/javascript">
    function tijiaoInput() {
        var url = $("#tijiaoInput").val();
        if (url == "") {
            alert("请输入翻页数目");
            $("#tijiaoInput").attr("value", "");
            return false;
        } else {
            var match = /^[1-9][0-9]*[0-9]*$/;
            if (!match.test(url)) {
                $("#tijiaoInput").val("");
                alert("请正确填写翻页数目");

                return false;
            }
        }
        $("#setchInfo")
            .attr("action", "<c:url value='/noticeIndex/"+url+"' />");
        $("#setchInfo").submit();
        return false;
    }
</script>



</html>